-
Notifications
You must be signed in to change notification settings - Fork 786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: alert enriching is always disposable (no matter query params) #2293
fix: alert enriching is always disposable (no matter query params) #2293
Conversation
@imorph is attempting to deploy a commit to the KeepHQ Team on Vercel. A member of the Team first needs to authorize it. |
@imorph great catch! waiting for tests and merging! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you! Great catch 🫶
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
e27c93a
to
ef8fdf4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
💪 Well done @imorph! Two PRs merged already! 🎉🥳 With your second PR, you're on a roll, and your contributions are already making a difference. 🌟 |
📑 Description
/close #2292
In
_enrich_alert
function, you have the following parameter:Here, you're using
Query
, which is designed to be used in FastAPI endpoint functions to declare query parameters. When you useQuery
, FastAPI expects to parse this parameter from the incoming HTTP request.However,
_enrich_alert
is not an endpoint function; it's a helper function that's being called directly from another function (enrich_alert
). Seems like FastAPI's dependency injection system isn't in play for_enrich_alert
, anddispose_on_new_alert
is not being set from the HTTP request query parameters. Instead, it's getting assigned the Query object itself as the default value. Sincedispose_on_new_alert
is set to theQuery
object, it becomes truthy in a boolean context. Therefore, when execution reachif dispose_on_new_alert
condition in_enrich_alert
it evaluates asTrue
.In logs it looks like this:
✅ Checks